<template>
    <div>
        <el-bread></el-bread>
        <el-button @click="addDialog" class="addinfo" type="primary" plain size="small">添加</el-button>
        <v-list @edit="edit"></v-list>
        <v-dialog ref="diaInfo" @cancel="cancel" :addInfo="addInfo"></v-dialog>
    </div>
</template>

<script>
import vList from './list.vue';
import vDialog from './dialog.vue';
export default {
    data(){
        return{
            addInfo:{
                isShow:false,
                isAdd:true
            }
        }
    },
    components:{
        vDialog,
        vList
    },
    methods:{
        addDialog(){
            this.addInfo.isShow = true;
            this.addInfo.isAdd = true
        },
        edit(e){
            this.addInfo.isShow = true;
            this.addInfo.isAdd = false;
            this.$refs.diaInfo.lookup(e)
        },
        cancel(e){
            this.addInfo.isShow = e
        }
    }
}
</script>

<style scoped>
.addinfo{
    margin: 10px 5px;
}
</style>